package com.htgd.gardenexpo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.htgd.gardenexpo.entity.GeConUserCompete;
import com.htgd.gardenexpo.page.CompeteQuery;
import com.htgd.gardenexpo.page.CompeteUserQuery;
import com.htgd.gardenexpo.page.MySportsQuery;
import com.htgd.gardenexpo.vo.GeConUserCompeteVO;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * @author: 王秀田
 * @date: 2024/11/26 14:40
 * @description: TODO
 */
public interface GeConUserCompeteMapper extends BaseMapper<GeConUserCompete> {

    List<HashMap> pageList(@Param("ev") CompeteQuery competeQuery);

    List<HashMap> queryList(CompeteQuery competeQuery);

    int updateUserCompete(GeConUserCompete geConUserCompete);

    int updateUserCompete1(GeConUserCompete geConUserCompete);

    int updateScoreStatus(@Param("scoreStatus") Integer scoreStatus,
                          @Param("userId")Long userId,
                          @Param("motionId")String motionId,
                          @Param("openId")String openId);

    int updateScoreStatusByMotionId(@Param("scoreStatus") Integer scoreStatus,
                                    @Param("motionId")String motionId);

    List<HashMap> mySportsList(MySportsQuery mySportsQuery);

    double getSumMileageWeek(String openId);

    double getSumMileageLastWeek(String openId);

    double getSumMileageLastWeek1(String openId);

    double getSumMileageLastWeek2(String openId);

    int getSumSportsTimeWeek(String openId);

    int getSumSportsTimeLastWeek(String openId);

    int getSumSportsTimeLastWeek1(String openId);

    int getSumSportsTimeLastWeek2(String openId);

    int getCountSportsDays(@Param("type") String type, @Param("openId") String openId);

    int getCountSportsTimes(@Param("type") String type, @Param("openId") String openId);

    int getCountSportsMileages(@Param("type") String type, @Param("openId") String openId);

    int getMonthCompetitionNum(@Param("openId") String openId,@Param("lastMonthStr") String lastMonthStr);

    int getMonthChallengeNum(@Param("openId") String openId,@Param("lastMonthStr") String lastMonthStr);

    int getQuarterCompetitionNum(@Param("openId")String openId, @Param("lastQuarterYear")int lastQuarterYear, @Param("lastQuarter")int lastQuarter);

    int getQuarterChallengeNum(@Param("openId")String openId, @Param("lastQuarterYear")int lastQuarterYear, @Param("lastQuarter")int lastQuarter);

    int getYearCompetitionNum(@Param("openId")String openId, @Param("lastYear")int lastYear);

    int getYearChallengeNum(@Param("openId")String openId, @Param("lastYear")int lastYear);

    List<GeConUserCompeteVO> listNew(CompeteUserQuery competeUserQuery);
}
